﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;

namespace ChuanPlus
{
    public class StockCard: XPLiteObject
    {
        long fTransID;
        [Key]
        public long TransID
        {
            get { return fTransID; }
            set { SetPropertyValue<long>("TransID", ref fTransID, value); }
        }
        Stock fStockID;
        
        public Stock StockID
        {
            get { return fStockID; }
            set { SetPropertyValue<Stock>("StockID", ref fStockID, value); }
        }
        DateTime fTransDate;
        public DateTime TransDate
        {
            get { return fTransDate; }
            set { SetPropertyValue<DateTime>("TransDate", ref fTransDate, value); }
        }
        double fInQuantity;
        public double InQuantity
        {
            get { return fInQuantity; }
            set { SetPropertyValue<double>("InQuantity", ref fInQuantity, value); }
        }
        double fOutQuantity;
        public double OutQuantity
        {
            get { return fOutQuantity; }
            set { SetPropertyValue<double>("OutQuantity", ref fOutQuantity, value); }
        }
        double fBalance;
        public double Balance
        {
            get { return fBalance; }
            set { SetPropertyValue<double>("Balance", ref fBalance, value); }
        }
        TransactionType fTransactionTypeID;        
        public TransactionType TransactionTypeID
        {
            get { return fTransactionTypeID; }
            set { SetPropertyValue<TransactionType>("TransactionTypeID", ref fTransactionTypeID, value); }
        }
        string fTrackNo;
        [Size(20)]
        public string TrackNo
        {
            get { return fTrackNo; }
            set { SetPropertyValue<string>("TrackNo", ref fTrackNo, value); }
        }
        public StockCard(Session session) : base(session) { }
        public StockCard() : base(Session.DefaultSession) { }
        public override void AfterConstruction() { base.AfterConstruction(); }
        /// <summary>
        /// Initializes a new instance of the StockCard class.
        /// </summary>
        /// <param name="fTransID"></param>
        /// <param name="fID"></param>
        /// <param name="fTransDate"></param>
        /// <param name="fInQuantity"></param>
        /// <param name="fOutQuantity"></param>
        /// <param name="fBalance"></param>
        /// <param name="fTransactionTypeID"></param>
        /// <param name="fTrackNo"></param>
        public StockCard(Session s,long fTransID, Stock fStockID, DateTime fTransDate, double fInQuantity, double fOutQuantity, double fBalance, TransactionType fTransactionTypeID, string fTrackNo):base(s)
        {
            this.fTransID = fTransID;
            this.fStockID = fStockID;
            this.fTransDate = fTransDate;
            this.fInQuantity = fInQuantity;
            this.fOutQuantity = fOutQuantity;
            this.fBalance = fBalance;
            this.fTransactionTypeID = fTransactionTypeID;
            this.fTrackNo = fTrackNo;
        }
        /// <summary>
        /// Initializes a new instance of the StockCard class.
        /// </summary>
        /// <param name="fTransID"></param>
        /// <param name="fID"></param>
        /// <param name="fTransDate"></param>
        /// <param name="fInQuantity"></param>
        /// <param name="fOutQuantity"></param>
        /// <param name="fBalance"></param>
        /// <param name="fTransactionTypeID"></param>
        /// <param name="fTrackNo"></param>
        public StockCard(long fTransID, Stock fStockID, DateTime fTransDate, double fInQuantity, double fOutQuantity, double fBalance, TransactionType fTransactionTypeID, string fTrackNo)
        {
            this.fTransID = fTransID;
            this.fStockID = fStockID;
            this.fTransDate = fTransDate;
            this.fInQuantity = fInQuantity;
            this.fOutQuantity = fOutQuantity;
            this.fBalance = fBalance;
            this.fTransactionTypeID = fTransactionTypeID;
            this.fTrackNo = fTrackNo;
        }
    }
}
